//
// Created by mac on 1/28/22.
//



int rangeBitwiseAnd(int left, int right) {
    int shift = 0;
    // 找到公共前缀
    while (left < right) {
        left >>= 1;
        right >>= 1;
        shift++;
    }

    return left <<= shift;
}